<?php

class StaticPagesModule extends fvModule {

	function __construct () {
		$moduleName = strtolower(substr(__CLASS__, 0, -6));
		parent::__construct(fvSite::$fvConfig->get("modules.{$moduleName}.smarty.template"),
		fvSite::$fvConfig->get("modules.{$moduleName}.smarty.compile"),
		fvSite::$Layoult);
	}


	function showFull () {
		return "";
	}

	function showShort($params) {
	  
		$this->count = intval($params['count_short']);
		$this->moduleID = $this->getParams()->getParameter("moduleID");
	  
		return $this->__display("short_list.tpl");
	  
	}

	function showIndex($params) {
		$pageName = $params['tech_name'] or fvRequest::getInstance()->getRequestParameter("tech_name");
		if (empty($pageName)){
			$pageName = fvRequest::getInstance()->getRequestParameter("module");
		}
		$Page = StaticPagesManager::getInstance()->getByTechUrl($pageName);
		if (count($Page) == 1 && is_object($Page = $Page[0])) {
			$this->__assign("sp", $Page);
		} else {
			$this->__assign("sp", new StaticPages());
			fvDispatcher::getInstance()->redirect(fvSite::$fvConfig->get('page_404'), 0, 404);
		}
		return $this->__display("one.tpl");
	}
}

?>
